import { http } from '@/utils'

// 1.获取新闻详情
export interface DetailResponse {
    code: number;
    data: Datum[];
    recom_data: string[];
    [property: string]: any;
}

export interface Datum {
    author?: string;
    content?: string;
    default_image?: string;
    description?: string;
    id?: number;
    keywords?: string;
    release_time?: string;
    tags?: string;
    title?: string;
    [property: string]: any;
}

export type ReqParams = {
    id: string | undefined
  }

export function fetchNewsDetailAPI(params: ReqParams) {
    return http.request<DetailResponse>({
        url: '/news/detail/',
        params,
    })
}